<?php
//打开图片
$src = 'img/001.jpg';
$info = getimagesize($src);
$type = image_type_to_extension($info[2], false);
//操作图片
$imagecreatefromtype = "imagecreatefrom{$type}";
$image = $imagecreatefromtype($src);	//创建一个新图像
$size = 30;
$angle = 0;
$color = imagecolorallocatealpha($image, 0, 0, 0, 50);	//为一幅图像分配颜色+alpha
$x = $info[0] - 190;
$y = $info[1] - 30;
$fontfile = 'SIMSUNB.TTF';
$text = 'hotsuitor';
imagettftext($image, $size, $angle, $x, $y, $color, $fontfile, $text);
//输出图片
header("Content-type: ".$info['mime']);
$imagetype = "image{$type}";
$imagetype($image);
$imagetype($image,'img/aa.'.$type);
//销毁图片
imagedestroy($image);
?>